using System;
using System.ComponentModel.DataAnnotations;

namespace WorkFlowCore.BusinessDemo.Web.Models
{
    public class UserUpdateViewModel
    {
        public int Id { get; set; }

        [Required(ErrorMessage = "姓名不能为空")]
        [Display(Name = "姓名")]
        [MaxLength(50, ErrorMessage = "姓名长度不能超过50个字符")]
        public string Name { get; set; }

        [Display(Name = "电话")]
        [MaxLength(20, ErrorMessage = "电话长度不能超过20个字符")]
        public string Phone { get; set; }

        [Display(Name = "邮箱")]
        [EmailAddress(ErrorMessage = "邮箱格式不正确")]
        [MaxLength(100, ErrorMessage = "邮箱长度不能超过100个字符")]
        public string Email { get; set; }

        [Required(ErrorMessage = "请选择性别")]
        [Display(Name = "性别")]
        [Range(0, 2, ErrorMessage = "请选择有效的性别")]
        public int Gender { get; set; }

        [Display(Name = "出生日期")]
        [DataType(DataType.Date)]
        public DateTime? BirthDate { get; set; }

        [Display(Name = "户籍地")]
        [MaxLength(200, ErrorMessage = "户籍地长度不能超过200个字符")]
        public string Hometown { get; set; }
    }
}
